<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>PCMS内容管理系统</title>
<link href="<?php echo $_tpl['css']; ?>admin.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function check()
{
	var item = document.getElementById( "cname" );

	if ( item.value == "" )
	{
		alert( "请输入名称" );
		item.focus();
		return false;
	}

	var item = document.getElementById( "value" );

	if ( item.value == "" )
	{
		alert( "请输入值" );
		item.focus();
		return false;
	}

	var item = document.getElementById( "ename" );

	if ( item.value == "" )
	{
		alert( "请输入变量名" );
		item.focus();
		return false;
	}

	var item = document.getElementById( "type_id" );

	if ( item.options[item.selectedIndex].value == 0 )
	{
		alert( "请输入选择类型" );
		item.focus();
		return false;
	}


	document.getElementById( "submit" ).disabled = true;
	return true;
}
</script>
</head>
<body>
<form id="apply" method="post" onsubmit="return check()">
<input type="hidden" name="reference" value="<?php echo $reference; ?>">
<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1">
  <tr>
    <td width="38%" height="20" align="right" bgcolor="#272727">类型</td>
    <td width="62%" height="20" colspan="2" align="left" bgcolor="#272727"><select id="type_id" name="type_id"><option value="0">请选择</option><?php
	if ( isset( $type_data ) && is_array( $type_data ) )
	{
		foreach ( $type_data as $index => $value )
		{
			echo '<option value="' . $value['id'] . '">' . $value['name'] . '</option>';
		}
	}
	?></select></td>
  <tr>
    <td width="38%" height="20" align="right" bgcolor="#272727">中文名称</td>
    <td width="62%" height="20" colspan="2" align="left" bgcolor="#272727"><input type="text" name="cname" id="cname"></td>
  </tr>
  <tr>
    <td width="38%" height="20" align="right" bgcolor="#272727">英文变量名</td>
    <td width="62%" height="20" colspan="2" align="left" bgcolor="#272727"><input type="text" name="ename" id="ename"> *一旦添加不可修改</td>
  </tr>
  <tr>
    <td width="38%" height="20" align="right" bgcolor="#272727">值</td>
    <td width="62%" height="20" colspan="2" align="left" bgcolor="#272727"><input type="text" name="value" id="value" size="60" ></td>
  </tr>
  </tr>
   <tr>
    <td width="38%" height="20" align="right" bgcolor="#272727">参数说明</td>
    <td width="62%" height="20" colspan="2" align="left" bgcolor="#272727"><input type="text" name="memo" id="memo" size="60" ></td>
  </tr>
 <tr>
    <td height="20" colspan="16" align="center" bgcolor="#000000">
		<table width="40%">
			<tr align="center">
				<td><input class="btn2" type="submit" id="submit" value="提交"></td>
				<td><input class="btn2" type="button" value="返回" onclick="window.location.href='<?php echo $reference; ?>'"></td>
			</tr>
		</table>
	</td>
  </tr>
</table>
</form>
</body>
</html>